<div class="block-main">
<div class="breadcrumbs">
	<div xmlns:v="http://rdf.data-vocabulary.org/#" class="cufont"><span typeof="v:Breadcrumb">XẾP HẠNG 20 PHIM</span></div>
</div>
<?php if (!$ipid) { ?>
<div class="top_chart_col top_chart_col_left">
<div class="tc_title">
    <h2 class="cufont">PHIM XEM NHIỀU</h2>
</div>
<ul class="list-rank">
<?php
$_filmlist	=	$db->database("phimid,tenphim,tentienganh,phimimg,thoiluong,chatluong","film","phimid != 0 ORDER BY viewed DESC LIMIT 20");
for($i=0;$i<count($_filmlist);$i++) {
	$_url_hdnew	=	url_link($_filmlist[$i][1].'-'.$_filmlist[$i][2],$_filmlist[$i][0],'phim');
	$_filmtxt	=	get_data('film_info','phimtxt','phimid = '.$_filmlist[$i][0]);
	$_num = $i + 1;
	?>
	<li>
	<a href="<?=$_url_hdnew?>">
	<span class="icon-num"><?=$_num?></span>
	<img src="<?=$_filmlist[$i][3]?>" alt="<?=$_filmlist[$i][1]?>">
	<h3><?=$_filmlist[$i][1]?></h3>
	</a>
	<div><?=$_filmlist[$i][4]?> | <?=$_filmlist[$i][5]?></div>
	<div class="txt-info"><?=cut($_filmtxt,200)?></div>
	</li>
	<div class="clr"></div>
<? } ?>
</ul>
</div>

<div class="top_chart_col top_chart_col_left">
<div class="tc_title">
    <h2 class="cufont">PHIM YÊU THÍCH</h2>
</div>
<ul class="list-rank">
<?php
$filmlist2	=	$db->database("phimid,tenphim,tentienganh,phimimg,thoiluong,chatluong","film","phimid != 0 ORDER BY likephim LIMIT 20");
for($i=0;$i<count($filmlist2);$i++) {
	$url_hdnew_	=	url_link($filmlist2[$i][1].'-'.$filmlist2[$i][2],$filmlist2[$i][0],'phim');
	$filmtxt_	=	get_data('film_info','phimtxt','phimid = '.$filmlist2[$i][0]);
	$num_ = $i + 1;
	?>
	<li>
	<a href="<?=$url_hdnew_?>">
	<span class="icon-num"><?=$num_?></span>
	<img src="<?=$filmlist2[$i][3]?>" alt="<?=$filmlist2[$i][1]?>">
	<h3><?=$filmlist2[$i][1]?></h3>
	</a>
	<div><?=$filmlist2[$i][4]?> | <?=$filmlist2[$i][5]?></div>
	<div class="txt-info"><?=cut($filmtxt_,200)?></div>
	</li>
	<div class="clr"></div>
<? } ?>
</ul>

</div>

<div class="top_chart_col top_chart_col_right">
<div class="tc_title">
    <h2 class="cufont">PHIM ĐỀ CỬ</h2>
</div>
<ul class="list-rank">
<?php
$filmlist	=	$db->database("phimid,tenphim,tentienganh,phimimg,thoiluong,chatluong","film","phimdecu = 1 ORDER BY viewed LIMIT 20");
for($i=0;$i<count($filmlist);$i++) {
	$url_hdnew	=	url_link($filmlist[$i][1].'-'.$filmlist[$i][2],$filmlist[$i][0],'phim');
	$filmtxt	=	get_data('film_info','phimtxt','phimid = '.$filmlist[$i][0]);
	$num = $i + 1;
	?>
	<li>
	<a href="<?=$url_hdnew?>">
	<span class="icon-num"><?=$num?></span>
	<img src="<?=$filmlist[$i][3]?>" alt="<?=$filmlist[$i][1]?>">
	<h3><?=$filmlist[$i][1]?></h3>
	</a>
	<div><?=$filmlist[$i][4]?> | <?=$filmlist[$i][5]?></div>
	<div class="txt-info"><?=cut($filmtxt,200)?></div>
	</li>
	<div class="clr"></div>
<? } ?>
</ul>

</div>

<? } ?>
<div class="clr"></div>
</div>